package com.amkai.aes.webservice.binary.objecthandler;

import java.io.Serializable;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.amkai.aes.aescommon.service.messaging.MessagingJob;
import com.amkai.aes.aescommon.service.messaging.MessagingResult;
import com.amkai.aes.webservice.binary.JobObjectHandler;
import com.amkai.extensions.messaging.MessagingProvider;

public class MessagingHandler implements JobObjectHandler<MessagingJob, Serializable, MessagingResult> {

	private static final Log log = LogFactory.getLog(MessagingHandler.class);

	public MessagingResult process(MessagingJob job, Serializable object) throws Exception {
		MessagingProvider mp = new MessagingProvider();
		try {
			return mp.processJob(job, object);
		} catch (Throwable e) {
			log.error("",e);
			throw new Exception(e);
		}
	}

}
